package design_patterns.factory;

import design_patterns.Main;

import java.lang.reflect.Proxy;

public class MainFactroy {
    public static <T> T create(Object target){
        Main main=new Main();
        main.setTarget(target);
        return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(),target.getClass().getInterfaces(),main);
    }
}
